package com.zt.event.feishu;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.springframework.http.HttpStatus;

import java.util.List;

/**
 * @author: lixiaode
 * @version: 1.0
 * @description: TODO
 * @date: 2022/8/12 13:44
 **/
@Getter
@Setter
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class FeiShuResultVO {
    private int code;
    private String msg;
    private Data data;

    public static FeiShuResultVO faild(String msg){
        return FeiShuResultVO.builder()
                .code(HttpStatus.BAD_REQUEST.value())
                .msg(msg)
                .build();
    }


}

@Getter
@Setter
class Sender {
    private String id;
    @JsonProperty("id_type")
    private String idType;
    @JsonProperty("sender_type")
    private String senderType;
    @JsonProperty("tenant_key")
    private String tenantKey;
}
@Getter
@Setter
class Body {
    private String content;
}

@Getter
@Setter
class Mentions {
    private String key;
    private String id;
    @JsonProperty("id_type")
    private String idType;
    private String name;
    @JsonProperty("tenant_key")
    private String tenantKey;
}
@Getter
@Setter
class Data {
    @JsonProperty("message_id")
    private String messageId;
    @JsonProperty("root_id")
    private String rootId;
    @JsonProperty("parent_id")
    private String parentId;
    @JsonProperty("msg_type")
    private String msgType;
    @JsonProperty("create_time")
    private String createTime;
    @JsonProperty("update_time")
    private String updateTime;
    private boolean deleted;
    private boolean updated;
    @JsonProperty("chat_id")
    private String chatId;
    private Sender sender;
    private Body body;
    private List<Mentions> mentions;
    @JsonProperty("upper_message_id")
    private String upperMessageId;
}


